﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using VIA.Presentation;

namespace VIA.Presentation.Converters
{
    public class LogItemConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if(value is LogItem item)
            {
                return $"[{item.DateTime.ToString("yyyy-MM-dd HH:mm:ss.fff")}]:{item.Message}";
            }
            return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
